package com.stockz.equity.charting.event.listener;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

import com.stockz.equity.charting.builder.StockChartViewBuilder;
import com.stockz.equity.charting.decorator.StockChartViewPaintTimeDecorator;
import com.stockz.equity.charting.event.StockChartPanelFirstTimePaintEvent;
import com.stockz.equity.charting.view.StockChartView;

@Component
public class StockChartPanelFirstTimePaintEventListener implements
		ApplicationListener<StockChartPanelFirstTimePaintEvent> {

	@Autowired private StockChartViewBuilder stockChartViewBuilder;
	@Autowired private StockChartViewPaintTimeDecorator stockChartViewPaintTimeDecorator;
	@Autowired private StockChartView stockChartView;
	
	@Override
	public void onApplicationEvent(StockChartPanelFirstTimePaintEvent paramE) {
		stockChartViewBuilder.build();
		stockChartViewPaintTimeDecorator.decorate(stockChartView);
	}
}
